package com.weiyun.shortlink.admin.controller;

import com.weiyun.shortlink.admin.common.convention.result.Result;
import com.weiyun.shortlink.admin.remote.ShortLinkActualRemoteService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/***
 *   @Author:weiyun
 *
 */
@RestController
@RequiredArgsConstructor
public class UrITitleController {

    private final ShortLinkActualRemoteService shortLinkActualRemoteService;
    @GetMapping("/api/shortLink/admin/v1/title")
    public Result<String> getTitleByUrl(@RequestParam("url") String url){
        return shortLinkActualRemoteService.getTitleByUrl(url);
    }
}
